package com.tengju.bff.interfaces.manage.crm.chief.assembler;

import com.tengju.bff.interfaces.manage.club.vo.ClubVO;
import com.tengju.bff.interfaces.manage.crm.chief.vo.ChiefClubVO;
import com.tengju.user.domain.model.chief.ChiefId;
import com.tengju.user.domain.model.club.Club;

import java.util.List;
import java.util.stream.Collectors;

public class ChiefClubAssembler {


    public static ChiefClubVO modelToVO(ChiefId chiefId, List<Club> clubList) {


        ChiefClubVO chiefClubVO = new ChiefClubVO();


        List<ClubVO> clubVOList = clubList.stream().map(club -> {
            ClubVO clubVO = new ClubVO();
            clubVO.setClubId(club.getClubId().getValue());
            clubVO.setClubName(club.getClubName());
            return clubVO;
        }).collect(Collectors.toList());

        chiefClubVO.setChiefId(chiefId.getValue());
        chiefClubVO.setClubVOList(clubVOList);

        return chiefClubVO;
    }

}
